package spring.cloud.tasks.executor.task_type;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

@Slf4j
@Setter
@Getter
public class TaskTypeManager {

    private static final ConcurrentMap<String, TaskType> jobTypeMap = new ConcurrentHashMap<>();

    public static void register(TaskType jobType) {
        jobTypeMap.put(jobType.getName(), jobType);
    }

    public static TaskType get(String name) {
        return jobTypeMap.get(name);
    }

}
